﻿
/*
NAILSUPERSTORE ® COMPANY
 
[HISTORY]
Created By  	: NGUYEN VAN TY
Created Date	: 12/24/2010
Modified By     :
Modified Date   :
Note            :

*/

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using CommonTagTime.DataAccess;
using CommonTagTime.ModelObject;
namespace CommonTagTime.Business
{
    public class busContentProduct
    {
        //------------------------------------------------
        //FIELD TABLE
        //------------------------------------------------
        public const string TABLE = "ContentProduct";
        public const string PAGEID = "PageId";
        public const string PAGEURL = "PageURL";
        public const string LANGUAGE = "Language";
        public const string TITLE = "Title";
        public const string CONTENT = "Content";
        public const string METADESCRIPTION = "MetaDescription";
        public const string METAKEYWORDS = "MetaKeywords";
        public const string NAME = "Name";     
        public const string CREATEDBY = "CreatedBy";
        public const string CREATEDDATE = "CreatedDate";
        public const string UPDATEDBY = "UpdatedBy";
        public const string UPDATEDDATE = "UpdatedDate";       
        public const string ORDERBY = "OrderBy";
        public const string ORDERDIRECTION = "OrderDirection";
        public const string CURRENTPAGE = "CurrentPage";
        public const string PAGESIZE = "PageSize";     
        public const string TOTALRECORDS = "TotalRecords";
        public const string CONDITION = "Condition";
        public const string SORTORDER = "SortORder";
        private daoContentProduct _daoContentProduct;
        //------------------------------------------------
        //PUBLIC
        //------------------------------------------------
        public busContentProduct()
        {
            _daoContentProduct = new daoContentProduct();
        }
        public int Insert(ContentProduct objContentProduct)
        {
            if (objContentProduct == null)
                return 0;
            return _daoContentProduct.Insert(objContentProduct);
        }
        public int Update(ContentProduct objContentProduct)
        {
            if (objContentProduct == null)
                return 0;
            return _daoContentProduct.Update(objContentProduct);
        }       
        public bool Delete(int ContentProductID)
        {
            if (ContentProductID <= 0)
                return false;
            return _daoContentProduct.Delete(ContentProductID);
        }
        public bool OrderDown(int _PageId)
        {
            bool result = _daoContentProduct.OrderDown(_PageId);
            if (result)
                clsCacheUtil.RemoveCacheWithPrefix("ContentProduct_");
            return result;
        }
        public bool OrderUp(int _PageId)
        {
            bool result = _daoContentProduct.OrderUp(_PageId);
            if (result)
                clsCacheUtil.RemoveCacheWithPrefix("ContentProduct_");
            return result;
        }
        public ContentProduct GetByID(int ContentProductID)
        {
            if (ContentProductID <= 0)
                return null;
            return _daoContentProduct.GetByID(ContentProductID);
        }
        public ContentProduct GetByURL(string url, int language)
        {           
            return _daoContentProduct.GetByURL(url, language);
        }
        public ContentProductCollection List(ContentProduct objContentProduct)
        {
            return _daoContentProduct.List(objContentProduct);
        }
        public ContentProductCollection GetAll(ContentProduct objContentProduct)
        {
            return _daoContentProduct.GetAll(objContentProduct);
        }
    }
}

